// jiemianDlg.h : header file
//

#if !defined(AFX_JIEMIANDLG_H__94FCFBC7_955D_4515_8EA9_257436560C1E__INCLUDED_)
#define AFX_JIEMIANDLG_H__94FCFBC7_955D_4515_8EA9_257436560C1E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CJiemianDlg dialog
#include "Resource.h"
#include "MyButton.h"
#include "Include/ClientProcMsgObject_i.h"
#include "Include/Define.h"
#include "LauncherLayer.h"
#include <string>

typedef void (*StartFunc)(HWND hWndParent, const char* pszParam);
typedef void (*ReStartFunc)(const char* pszParam);
typedef void  (*MsgFunc)(HWND hWndParent, DWORD msgid, DWORD wparam, DWORD lparam );
typedef void (*UpdateFunc)();
typedef void  (*MsgHandle)(HWND hWndParent);
typedef void  (*GetDescAndLoadstep)(char* desc, float* allfileProgress);



class CMicroMiniDlg : public CDialog
{
// Construction
public:
	CMicroMiniDlg(CWnd* pParent, const std::string& strProcPara, const std::string& openid, const std::string& openkey);	// standard constructor
	void Release();
	//{{AFX_DATA(CJiemianDlg)
	enum { IDD = IDD_JIEMIAN_DIALOG };
	// ClassWizard generated virtual function overrides
	void StartGame(char* startcmd);
protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
private:
    BOOL LoadLibrary();
    IClientProcMsgObject* CreateObj();
    void ReStartApp(LPCSTR lpszProc);
	void OnTimer(UINT_PTR nIDEvent);
	
	std::string m_strCmdline;
    std::string m_strProcPara;
	std::string m_strOpenid;
	std::string m_strOpenkey;
    IClientProcMsgObject* m_pProcMsgObj;
    HMODULE m_hModule;

	UpdateFunc			m_funStopAu;
	MsgHandle			m_funMsgHandle;
	GetDescAndLoadstep	m_funGetDescAndLoadstep;

	HMODULE				hModuleAu;
	CLauncherLayer	    m_Layer;
	CImage	            m_ImgStart;
	bool				m_bStartGame;
// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CJiemianDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg void OnClose();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnHelpInfo(HELPINFO* lpHelpInfo);
	afx_msg LRESULT OnNcHitTest(CPoint point);
	afx_msg void OnMove(int x, int y);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_JIEMIANDLG_H__94FCFBC7_955D_4515_8EA9_257436560C1E__INCLUDED_)
